<?php
/**
 * Created by PhpStorm.
 * User: CuYen
 * Date: 5/20/14
 * Time: 1:50 AM
 */
if(!defined('BASEPATH')) exit("Include you base path");
class Login extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
    }
    // index function
    public function index()
    {
        $user_acc = array(
            "username" => "tuanviet",
            "password" => "111"
        );
        $this->load->view("login/index", $user_acc);
    }
    //
    public function checklogin()
    {

        $username = $this->input->post("username", TRUE); // security XSS

        $password = $this->input->post("password", TRUE);
        // load model
        $this->load->model('users_working');
        if($this->users_working->check_login($username, $password))
        {
            echo "login success";
        } else {
            echo "False!";
        }
    }
}